/*
 * @lc app=leetcode.cn id=3151 lang=golang
 *
 * [3151] 特殊数组 I
 */
package Solutions

// @lc code=start
func isArraySpecial__(nums []int) bool {
	flag := true
	if nums[0]&1 == 0 {
		flag = false
	}
	for _, v := range nums {
		if v&1 == 0 && flag {
			flag = false
		} else if v&1 != 0 && !flag {
			flag = true
		} else {
			return false
		}
	}
	return true
}

// @lc code=end
